package lily.phs.healthedu;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import lily.phs.urh.R;
import android.app.Activity;
import android.content.Intent;

import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.view.animation.Animation;

import android.widget.AdapterView;
import android.widget.Button;
import android.widget.GridView;
import android.widget.LinearLayout;
import android.widget.MediaController;
import android.widget.SimpleAdapter;
import android.widget.TextView;
import android.widget.VideoView;
import android.widget.AdapterView.OnItemClickListener;

public class jizhenjijiu extends Activity {
	
	private TextView tv_mediName;
	private TextView tv_mediDetails;
	private VideoView vplay;
	private String jizhenjijius[]={
			"xinfeifusu.mp4",
			"waishangxianchangjijiu.mp4",
			"xinzangzouting.mp4",
			"yanwaishang.mp4",
			"fubusunshang.mp4",
			"jixingzhongdu.mp4",
			"guzhegailun.mp4",
			"huanjingsuozhijizheng.mp4",
			"tufashijianjiuyuan.mp4"
	};
	
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.shipin);
        
        vplay=(VideoView)this.findViewById(R.id.video);
        MediaController controller=new MediaController(this);
        vplay.setMediaController(controller);
        /*vplay.setVideoURI(Uri.parse("android.resource://com.chen.baihezhongyi/"+R.raw.hanguo));*/
        Intent in=this.getIntent();
        Bundle b=in.getExtras();
        int child=b.getInt("child");
        if(child<jizhenjijius.length&&child>=0){
        	vplay.setVideoPath("/sdcard//publichealth/jizhenjijiu/"+jizhenjijius[child]);
        }
        else{
        	vplay.setVideoPath("/sdcard/xinfeifusu.mp4");
        }
        vplay.start();
        
	}
	
	@Override
    protected void onDestroy(){
    	if(vplay!=null){
    		vplay.stopPlayback();
    	}
    	
    	super.onDestroy();
    }
	
}
